#!/bin/sh
# 使用Alibaba Cloud Toolkit 一键部署参考资料：https://blog.csdn.net/qq_38225558/article/details/94717175
# shellcheck disable=SC2164
cd /apply/geek-video
# shellcheck disable=SC2006
PID=`ps -ef | grep "video-1.0.0-SNAPSHOT.jar" | grep -v "grep" | awk '{print $2}'`
if [ -z "$PID" ]
then
  echo "App is start!"ls
else
  kill -9 "$PID"
  echo "App by restart!"ls
# TIPS：如果遇到脚本执行报错，可能是脚本文件跨系统编写导致的。可参考：https://www.cnblogs.com/zjiacun/p/8066841.html
fi
nohup java -jar video-1.0.0-SNAPSHOT.jar > geekVideo.log 2>&1 &